<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Secure</title>
<script type="text/javascript" src="javascripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="javascripts/ajax-public.js"></script>
</head>
<body>
	<div>
		<div id ="errordiv"></div>
		<label for="user">User:</label>
		<input id="user" type="text"></input>
		<br /> 
		<label for="password">Password:</label> 
		<input id="password" type="password"></input>
		<br /> 
		<input id="submit" type="submit" value="submit"></input>
	</div>
	<script type="text/javascript">
	 $(document).ready(function(){
	 	$("#submit").click(function(){
			var url="/examine/login/do?user="+$("#user").val()+"&password="+$("#password").val();
			ajaxJsonAsync(url,function(data){
				switch(data.action){
					case "error":
					$("#errordiv").text(data.message);
					break;
					case "redirect":
					window.location.href=data.url;
					break;
				}
			});
		});
	 });
	</script>
</body>
</html>